package Composite;

import Composite.impl.City;
import Composite.impl.Composite;

/**
 * @author chengjunjie
 * @date 2025-09-10
 */

public class CompositeDemo {
    public static void main(String[] args) {
        Composite china = new Composite();
        china.add(new City(1000)); // 北京
        china.add(new City(2000)); // 上海

        Composite shanxi = new Composite(); // 山西
        shanxi.add(new City(1200)); // 太原
        shanxi.add(new City(2200)); //大同

        china.add(shanxi);

        System.out.println(china.count());
    }
}
